PSA Object Model Diagrams

VersionConfigService

global with sharing class VersionConfigService

service to create, modify and validate custom configurations for project versioning and baselines.

Methods

deleteVersionConfigDetails

global static void deleteVersionConfigDetails(List<Id> configIds)

This method deletes the Version_Config__c objects with the list of IDs as passed in.

Input Parameters

Name Type Description
configIds List<Id> List of IDs to be deleted.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

getActiveVersionConfig

global static Version_Config__c getActiveVersionConfig()

This method returns the active Version_Config__c object, or the standard Version_Config__c object if there is not an active custom config.

Return Value

The active Version_Config__c record.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

getAllVersionConfigDetails

global static VersionConfigService.VersionConfigDetails[] getAllVersionConfigDetails()

This method loads the ID, Unique_Name__c, Default__c, Summary__c and LastModifiedDate fields on all Version_Config__c objects

Return Value

List of Version_Config__c records.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

getConfigById

global static Version_Config__c getConfigById(Id configId)

This method returns the Version_Config__c object with the ID as passed in.

Input Parameters

Name Type Description
configId Id The ID of the Version_Config__c object to return.

Return Value

The Version_Config__c object with the given ID.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

getVersionCaptureConfigById

global static VersionConfigService.VersionCaptureConfig getVersionCaptureConfigById(Id configId)

This method returns the VersionCaptureConfig object with the ID as passed in.

Input Parameters

Name Type Description
configId Id The ID of the VersionCaptureConfig object to return.

Return Value

The VersionCaptureConfig object with the given ID.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

saveCaptureConfig

global static VersionConfigService.VersionCaptureConfig saveCaptureConfig(Id configId, VersionConfigService.VersionCaptureConfig toSave)

This method saves the given VersionCaptureConfig to the Version_Config__c object with the given ID.

Input Parameters

Name Type Description
configId Id ID of Version_Config__c objects to be saved.
toSave VersionConfigService.VersionCaptureConfig VersionCaptureConfig object to be saved to the Version_Config__c.

Return Value

The saved VersionConfigService.VersionCaptureConfig.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

saveVersionConfigDetails

global static VersionConfigService.VersionConfigDetails[] saveVersionConfigDetails(List<VersionConfigService.VersionConfigDetails> details)

This method saves the given list of VersionConfigDetails to their equivalent Version_Config__c objects.

Input Parameters

Name Type Description
details List<VersionConfigService.VersionConfigDetails> List of VersionConfigDetails to be saved.

Return Value

Updated VersionConfigService.VersionConfigDetails records.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

validateCaptureConfig

global static VersionConfigService.ValidationResult[] validateCaptureConfig(Id[] configIds)

This method retrieves the Version_Config__c records with the given IDs and validates the VersionCaptureConfigs contained within.

Input Parameters

Name Type Description
configIds Id[] List of IDs of the VersionCaptureConfig objects to validate.

Return Value

Returns a list of validation results. One result per ID is returned in the order as given.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

validateCaptureConfig

global static VersionConfigService.ValidationResult[] validateCaptureConfig(VersionConfigService.VersionCaptureConfig[] captureConfigs)

This method validates the given VersionCaptureConfig objects.

Input Parameters

Name Type Description
captureConfigs VersionConfigService.VersionCaptureConfig[] VersionCaptureConfigs to validate.

Return Value

Returns a list of validation results. One result per ID is returned in the order as passed.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

VersionConfigService.VersionConfigDetails

global class VersionConfigDetails

Lightweight DTO for the details of the Version_Config__c object excluding the Capture_Config__c field. Used for quickly saving changes to the object such as Unique_Name__c and Default__c

Properties

Name Type Description
ConfigId Id The Salesforce ID of the Version_Config__c record represented by this DTO.
Name String The unique name of the Version_Config__c.
Summary String A description of the configuration.
IsDefault Boolean A flag to indicate whether this configuration is the one used when creating baselines and versions of not.
LastModifiedDate Datetime The Salesforce timestamp showing when the record was last changed.

Methods

VersionConfigDetails

global VersionConfigDetails()

VersionConfigService.VersionCaptureConfig

global class VersionCaptureConfig

A representation of the whole capture configuration.
The capture configuration is stored on the pse__Version_Config__c.Capture_Config__c field in JSON format.

Properties

Name Type Description
VersionedObjects VersionConfigService.VersionCaptureObject[] An array of all the objects you want to version as part of the configuration.

Methods

VersionCaptureConfig

global VersionCaptureConfig()

VersionConfigService.VersionCaptureObject

global class VersionCaptureObject

A representation of an object you want to version.

Properties

Name Type Description
VersionedFields VersionConfigService.VersionCaptureField[] An array of fields you want to version.
OriginalIdField String The API name of the field on the destination object that holds the ID of the original object.
OriginatorAPIName String The API name of the SObject you are versioning.
OriginatorProjectLookupFieldAPIName String The API name of the field on the original object that is the relationship used to link to the project you are versioning.
DestinationAPIName String The API name of the destination SObject that holds the content from the original record used to generate a version.
DestinationVersionLookupFieldAPIName String The API name of the field with a relationship to the master Version__c record. This field relationship can be a lookup or master detail.

Methods

VersionCaptureObject

global VersionCaptureObject()

VersionConfigService.VersionCaptureField

global class VersionCaptureField

A representation of the field you want to capture.

Properties

Name Type Description
OriginatorFieldAPIName String The API name of the field you want to capture from.
DestinationFieldAPIName String The API name of the field on the destination record to hold the copied value from the original record.

Methods

VersionCaptureField

global VersionCaptureField()

VersionConfigService.ValidationResult

global class ValidationResult

An instance of this object contains the results of a validation.
Users can quickly check if the validation passed with the HasFailed property then if a failure has occured check the FailedRecords list.

Properties

Name Type Description
FailedRecords List<VersionConfigService.ValidationFailure> A list of failed records. Depending when the validation failed the list can contain a wrapped record for the config, one or more objects, or one or more fields. The list is empty when there are no failures.
HasFailed Boolean An indication that the validation failed. If true, the FailedRecords list contains one or more items.

Methods

ValidationResult

global ValidationResult()

VersionConfigService.ValidationFailure

global class ValidationFailure

An object denoting a failure in the VersionConfigValidator, to be created from a ValidationResultWrapper.
Encapsulates any failures and the reasons for the failure.

Properties

Name Type Description
ErrorMessage String The error that caused the validation failure.
OriginatorName String The API name of the originator object which failed validation.
OriginatorLabel String The label of the originator object which failed validation.
DestinationName String The API name of the destination object which failed validation.
DestinationLabel String The label of the destination object which failed validation.
FieldName String The API name of the field which failed validation.
FieldLabel String The label of the field which failed validation.

Methods

ValidationFailure

global ValidationFailure()

© Copyright 2009–2021 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.